<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改简历')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-resume-edit" th:object="${resume}">
            

            <h4 class="form-header h4">面试者信息</h4>
            <input name="resId" th:field="*{resId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">面试的时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="evaTime" th:value="${#dates.format(evaluate.evaTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-3 control-label is-required">被面试人：</label>
                <div class="col-sm-8">
                    <input name="resName" th:field="*{resName}" class="form-control" type="text" required >
                </div>
            </div>

            <div class="form-group" >
                <label class="col-sm-3 control-label is-required">简历文件路径：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="resFile" th:field="*{resFile}" >
                    <div class="file-loading">
                        <input class="form-control file-upload" id="resFile" name="file222" type="file" disabled>
                    </div>
                </div>
            </div>
            <div class="form-group" tyle="display: none;" >    
                <label class="col-sm-3 control-label" >面试回数：</label>
                <div class="col-sm-8">
                    <input name="resNo" th:field="*{resNo}" class="form-control" type="text" disabled>
                </div>
            </div>
            
 
            <div class="form-group">    
                <label class="col-sm-3 control-label">主要技术：</label>
                <div class="col-sm-8">
                    <input name="resTechnology" th:field="${resume.resName}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">语言水平：</label>
                <div class="col-sm-8">
                    <input name="resLanguage" th:field="*{resLanguage}" class="form-control" type="text" disabled>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">面试官1：</label>
                <div class="col-sm-8">
                    <input name="userId1" th:field="${evaluate.userId1}" class="form-control" type="text" disabled>
                   
                </div>
            </div>
        
            <div class="form-group">    
                <label class="col-sm-3 control-label">面试官2：</label>
                <div class="col-sm-8">
                    <input name="userId2" th:field="${evaluate.userId2}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">面试官3：</label>
                <div class="col-sm-8">
                    <input name="userId3" th:field="${evaluate.userId3}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">面试官4：</label>
                <div class="col-sm-8">
                    <input name="userId4" th:field="${evaluate.userId4}" class="form-control" type="text" disabled>
                </div>
            </div>


            <h4 class="form-header h4">面试结果</h4>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">面试结果</label>
                <div class="col-sm-8">
                    <select name="resStatus" class="form-control m-b" required >
                        <option value="24">OK</option>
                        <option value="25">NG</option>
                        <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{resSex}"></option> -->
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">参考的BANd范围</label>
                <div class="col-sm-8">
                    <select name="resBan" th:field="*{resBan}" class="form-control m-b" required >
                        <option value="0">未选择</option>
                        <option value="1">P6</option>
                        <option value="2">P7</option>
                        <option value="3">P8</option>
                        <option value="4">P9</option>
                    </select>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">推荐的职位</label>
                <div class="col-sm-8">
                    <select name="resJob" th:field="*{resJob}"  class="form-control m-b" required >
                        <option value="0">未选择</option>
                        <option value="1">前端开发</option>
                        <option value="2">后端开发</option>
                        <option value="3">自动化测试</option>
                        <option value="4">大数据</option>
                    </select>
                </div>
            </div>



            <h4 class="form-header h4">考察能力</h4>



            <div class="form-group">    
                <label class="col-sm-8 control-left">1.技术水平和经验</label>
                <div class="col-sm-3">
                    <input name="eavAbility1" th:field="${evaluate.eavAbility1}" class="form-control js-range-slider" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">2.语言水平</label>
                <div class="col-sm-3">
                    <input name="eavAbility2" th:field="${evaluate.eavAbility2}" class="form-control js-range-slider" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">3.管理经验</label>
                <div class="col-sm-3">
                    <input name="eavAbility3" th:field="${evaluate.eavAbility3}" class="form-control js-range-slider" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">4.沟通能力</label>
                <div class="col-sm-3">
                    <input name="eavAbility4" th:field="${evaluate.eavAbility4}" class="form-control js-range-slider" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">5.长期AMS作业适应能力</label>
                <div class="col-sm-3">
                    <input name="eavAbility5" th:field="${evaluate.eavAbility5}" class="form-control js-range-slider" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">6.客户应对能力</label>
                <div class="col-sm-3">
                    <input name="eavAbility6" th:field="${evaluate.eavAbility6}" class="form-control js-range-slider" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">7.性格态度</label>
                <div class="col-sm-3">
                    <input name="eavAbility7" th:field="${evaluate.eavAbility7}" class="form-control js-range-slider" type="text" >
                </div>
            </div>




            <h4 class="form-header h4">确认事项</h4>



            <div class="form-group">    
                <label class="col-sm-8 control-left">1.即使当前position没有出差要求，未来如果需要出差，是否可以接受？可以接受为期多久的出差？</label>
                <div class="col-sm-3">
                    
                    <label class="toggle-switch switch-solid">
                        <input type="checkbox" name="evaIs1" id="evaIs1" th:checked="${evaluate.evaIs1 == '0' ? true : false}">
                        <span></span>
                    </label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">2.是否接受日本工作时间(早八晚五)以及日本日历出勤？(中国法定假日，如十一，春节期间等需正常上班)个别开发项目有可能根据项目实际进行适当调整，是否接受？</label>
                <div class="col-sm-3">
                    <label class="toggle-switch switch-solid">
                        <input type="checkbox" name="evaIs2"  id="evaIs2" th:checked="${evaluate.evaIs4 == '0' ? true : false}">
                        <span></span>
                    </label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">3.是否保证至少两年在本项目工作稳定？</label>
                <div class="col-sm-3">
                    <label class="toggle-switch switch-solid">
                        <input type="checkbox" name="evaIs3"  id="evaIs3" th:checked="${evaluate.evaIs4 == '0' ? true : false}">
                        <span></span>
                    </label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-8 control-left">4.如果有离开项目的计划，是否可以提前三个月同leader沟通？</label>
                <div class="col-sm-3">
                    <label class="toggle-switch switch-solid control-label">
                        <input type="checkbox" name="evaIs4" id="evaIs4" th:checked="${evaluate.evaIs2 == '0' ? true : false}">
                        <span></span>
                    </label>
                </div>  
            </div>



            <h4 class="form-header h4">comments</h4>


            <div class="row">
                <div class="col-sm-12">
                    <button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
                    <!-- <button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()" ><i class="fa fa-minus"> 删除</i></button> -->
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>


            <div class="layui-layer-btn layui-layer-btn-">
                <a class="layui-layer-btn0" onclick="javaScript:submitHandler();window.location.href = '/system/resume'">确定</a>
                <a class="layui-layer-btn1" onclick="javaScript:location.reload();" >重置</a>
                <a class="layui-layer-btn2" onclick="javaScript:window.history.back(); " >返回</a>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "system/resume";
        $("#form-resume-edit").validate({
            focusCleanup: true
        });
        // 数字选项的样式
        $(".js-range-slider").ionRangeSlider({

            grid: true,
            min: 0,
            max: 10,
            from: 5,
            step: 1,
            max_postfix: "+",
            // prefix: "分",
            postfix: "分",
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/evaluate", $('#form-resume-edit').serialize());
            }
        }

        $("input[name='resGdate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='ct']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='ut']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(".file-upload").each(function (i) {
            var val = $("input[name='" + this.id + "']").val()
            $(this).fileinput({
                'uploadUrl': ctx + 'common/upload',
                initialPreviewAsData: true,
                initialPreview: [val],
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
            $(this).fileinput('_initFileActions');
        });

        $(function() {
            var options = {
                data: [[${resume.commentsList}]],
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                    	return columnIndex + $.table.serialNumber(index);
                    }
                },
                {
                    field: 'comText',
                    align: 'center',
                    title: '备注描述',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='commentsList[%s].comText' value='%s'>", index, value);
                        return html;
                    }
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
                        return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
                    }
                }]
            };
            $.table.init(options);
        });

        function addRow() {
            var count = $("#" + table.options.id).bootstrapTable('getData').length;
            var row = {
                index: $.table.serialNumber(count),
                comText: "",
                cu: "",
                ct: "",
                uu: "",
                ut: "",
            }
            sub.addRow(row);
        }
    </script>
</body>
</html>